version="2020.2">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="518">Return an array with newly allocated instances of all available
+ line="520">Return an array with newly allocated instances of all available
signing engines; they will not be initialized.</doc>
<source-position filename="ostree-sign.h" line="161"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="524">an array of signing engines</doc>
+ line="526">an array of signing engines</doc>
<array name="GLib.PtrArray" c:type="GPtrArray*">
<type name="Sign"/>
</array>
throws="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="542">Create a new instance of a signing engine.</doc>
+ line="544">Create a new instance of a signing engine.</doc>
<source-position filename="ostree-sign.h" line="164"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="549">New signing engine, or %NULL if the engine is not known</doc>
+ line="551">New signing engine, or %NULL if the engine is not known</doc>
<type name="Sign" c:type="OstreeSign*"/>
</return-value>
<parameters>
<parameter name="name" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="544">the name of desired signature engine</doc>
+ line="546">the name of desired signature engine</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="316">@TRUE if @data has been signed at least with any single valid key,
+ line="317">@TRUE if @data has been signed at least with any single valid key,
@FALSE in case of error or no valid keys are available (@error will contain the reason).</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
line="307">the signatures to be checked</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
- <parameter name="out_success_message" transfer-ownership="none">
+ <parameter name="out_success_message"
+ direction="out"
+ caller-allocates="0"
+ transfer-ownership="full"
+ nullable="1"
+ optional="1"
+ allow-none="1">
+ <doc xml:space="preserve"
+ filename="ostree-sign.c"
+ line="308">success message returned by the signing engine</doc>
<type name="utf8" c:type="char**"/>
</parameter>
</parameters>
<virtual-method name="get_name" invoker="get_name" version="2020.2">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="436">Return the pointer to the name of currently used/selected signing engine.</doc>
+ line="438">Return the pointer to the name of currently used/selected signing engine.</doc>
<source-position filename="ostree-sign.h" line="68"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="442">pointer to the name
+ line="444">pointer to the name
@NULL in case of error (unlikely).</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="438">an #OstreeSign object</doc>
+ line="440">an #OstreeSign object</doc>
<type name="Sign" c:type="OstreeSign*"/>
</instance-parameter>
</parameters>
throws="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="456">Add a signature to a commit.
+ line="458">Add a signature to a commit.
Depending of the signing engine used you will need to load
the secret key with #ostree_sign_set_sk.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="469">@TRUE if commit has been signed successfully,
+ line="471">@TRUE if commit has been signed successfully,
@FALSE in case of error (@error will contain the reason).</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="458">an #OstreeSign object</doc>
+ line="460">an #OstreeSign object</doc>
<type name="Sign" c:type="OstreeSign*"/>
</instance-parameter>
<parameter name="repo" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="459">an #OsreeRepo object</doc>
+ line="461">an #OsreeRepo object</doc>
<type name="Repo" c:type="OstreeRepo*"/>
</parameter>
<parameter name="commit_checksum" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="460">SHA256 of given commit to sign</doc>
+ line="462">SHA256 of given commit to sign</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="cancellable"
allow-none="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="461">A #GCancellable</doc>
+ line="463">A #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
throws="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="370">Verify if commit is signed with known key.
+ line="371">Verify if commit is signed with known key.
Depending of the signing engine used you will need to load
the public key(s) for verification with #ostree_sign_set_pk,
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="384">@TRUE if commit has been verified successfully,
+ line="386">@TRUE if commit has been verified successfully,
@FALSE in case of error or no valid keys are available (@error will contain the reason).</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="372">an #OstreeSign object</doc>
+ line="373">an #OstreeSign object</doc>
<type name="Sign" c:type="OstreeSign*"/>
</instance-parameter>
<parameter name="repo" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="373">an #OsreeRepo object</doc>
+ line="374">an #OsreeRepo object</doc>
<type name="Repo" c:type="OstreeRepo*"/>
</parameter>
<parameter name="commit_checksum" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="374">SHA256 of given commit to verify</doc>
+ line="375">SHA256 of given commit to verify</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
- <parameter name="out_success_message" transfer-ownership="none">
+ <parameter name="out_success_message"
+ direction="out"
+ caller-allocates="0"
+ transfer-ownership="full"
+ nullable="1"
+ optional="1"
+ allow-none="1">
+ <doc xml:space="preserve"
+ filename="ostree-sign.c"
+ line="376">success message returned by the signing engine</doc>
<type name="utf8" c:type="char**"/>
</parameter>
<parameter name="cancellable"
allow-none="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="375">A #GCancellable</doc>
+ line="377">A #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="316">@TRUE if @data has been signed at least with any single valid key,
+ line="317">@TRUE if @data has been signed at least with any single valid key,
@FALSE in case of error or no valid keys are available (@error will contain the reason).</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
line="307">the signatures to be checked</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
- <parameter name="out_success_message" transfer-ownership="none">
+ <parameter name="out_success_message"
+ direction="out"
+ caller-allocates="0"
+ transfer-ownership="full"
+ nullable="1"
+ optional="1"
+ allow-none="1">
+ <doc xml:space="preserve"
+ filename="ostree-sign.c"
+ line="308">success message returned by the signing engine</doc>
<type name="utf8" c:type="char**"/>
</parameter>
</parameters>
version="2020.2">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="436">Return the pointer to the name of currently used/selected signing engine.</doc>
+ line="438">Return the pointer to the name of currently used/selected signing engine.</doc>
<source-position filename="ostree-sign.h" line="98"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="442">pointer to the name
+ line="444">pointer to the name
@NULL in case of error (unlikely).</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="438">an #OstreeSign object</doc>
+ line="440">an #OstreeSign object</doc>
<type name="Sign" c:type="OstreeSign*"/>
</instance-parameter>
</parameters>
throws="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="584">Add a signature to a summary file.
+ line="586">Add a signature to a summary file.
Based on ostree_repo_add_gpg_signature_summary implementation.</doc>
<source-position filename="ostree-sign.h" line="167"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="595">@TRUE if summary file has been signed with all provided keys</doc>
+ line="597">@TRUE if summary file has been signed with all provided keys</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="self" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="586">Self</doc>
+ line="588">Self</doc>
<type name="Sign" c:type="OstreeSign*"/>
</instance-parameter>
<parameter name="repo" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="587">ostree repository</doc>
+ line="589">ostree repository</doc>
<type name="Repo" c:type="OstreeRepo*"/>
</parameter>
<parameter name="keys" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="588">keys -- GVariant containing keys as GVarints specific to signature type.</doc>
+ line="590">keys -- GVariant containing keys as GVarints specific to signature type.</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
<parameter name="cancellable"
allow-none="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="589">A #GCancellable</doc>
+ line="591">A #GCancellable</doc>
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="442">pointer to the name
+ line="444">pointer to the name
@NULL in case of error (unlikely).</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameter name="self" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="438">an #OstreeSign object</doc>
+ line="440">an #OstreeSign object</doc>
<type name="Sign" c:type="OstreeSign*"/>
</parameter>
</parameters>
<return-value transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="316">@TRUE if @data has been signed at least with any single valid key,
+ line="317">@TRUE if @data has been signed at least with any single valid key,
@FALSE in case of error or no valid keys are available (@error will contain the reason).</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
line="307">the signatures to be checked</doc>
<type name="GLib.Variant" c:type="GVariant*"/>
</parameter>
- <parameter name="out_success_message" transfer-ownership="none">
+ <parameter name="out_success_message"
+ direction="out"
+ caller-allocates="0"
+ transfer-ownership="full"
+ nullable="1"
+ optional="1"
+ allow-none="1">
+ <doc xml:space="preserve"
+ filename="ostree-sign.c"
+ line="308">success message returned by the signing engine</doc>
<type name="utf8" c:type="char**"/>
</parameter>
</parameters>
version="2020.2">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="518">Return an array with newly allocated instances of all available
+ line="520">Return an array with newly allocated instances of all available
signing engines; they will not be initialized.</doc>
<source-position filename="ostree-sign.h" line="161"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="524">an array of signing engines</doc>
+ line="526">an array of signing engines</doc>
<array name="GLib.PtrArray" c:type="GPtrArray*">
<type name="Sign"/>
</array>
throws="1">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="542">Create a new instance of a signing engine.</doc>
+ line="544">Create a new instance of a signing engine.</doc>
<source-position filename="ostree-sign.h" line="164"/>
<return-value transfer-ownership="full">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="549">New signing engine, or %NULL if the engine is not known</doc>
+ line="551">New signing engine, or %NULL if the engine is not known</doc>
<type name="Sign" c:type="OstreeSign*"/>
</return-value>
<parameters>
<parameter name="name" transfer-ownership="none">
<doc xml:space="preserve"
filename="ostree-sign.c"
- line="544">the name of desired signature engine</doc>
+ line="546">the name of desired signature engine</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
fn commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
- fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, out_success_message: &str, cancellable: Option<&P>) -> Result<(), glib::Error>;
+ fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, signature: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
- fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, out_success_message: &str) -> Result<(), glib::Error>;
+ fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<GString>, glib::Error>;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
fn get_name(&self) -> Option<GString>;
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
- fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, out_success_message: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
+ fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error> {
unsafe {
+ let mut out_success_message = ptr::null_mut();
let mut error = ptr::null_mut();
- let _ = ostree_sys::ostree_sign_commit_verify(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, out_success_message.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
- if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+ let _ = ostree_sys::ostree_sign_commit_verify(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, &mut out_success_message, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) }
}
}
}
#[cfg(any(feature = "v2020_2", feature = "dox"))]
- fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant, out_success_message: &str) -> Result<(), glib::Error> {
+ fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<GString>, glib::Error> {
unsafe {
+ let mut out_success_message = ptr::null_mut();
let mut error = ptr::null_mut();
- let _ = ostree_sys::ostree_sign_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, out_success_message.to_glib_none().0, &mut error);
- if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+ let _ = ostree_sys::ostree_sign_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, &mut out_success_message, &mut error);
+ if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) }
}
}